<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>#{msg.gestioneRepartiTitle}</title>
    </h:head>
    <h:body>
        <div class="container">
            <ui:include src="Header.xhtml"/>
            <div class="content">
                <p:messages autoUpdate="true" closable="true"/>
                <h:form>
                    <p:dataTable id="tabella" value="#{reparto.reparti}" var="r">
                        <p:column headerText="#{msg.idTable}">
                            <p:outputLabel value="#{r.id}"/>
                        </p:column>
                        <p:column headerText="#{msg.nomeTable}" >
                            <p:outputLabel value="#{r.nome}"/>
                        </p:column>
                    </p:dataTable>
                    <br/>
                    <h3><p:outputLabel value="#{msg.creaReparto}"/></h3>
                    <h:panelGrid columns="2">
                        <p:outputLabel for="nome" value="#{msg.nomeForm}"/>
                        <p:inputText id="nome" value="#{reparto.nomeNuovoReparto}"/>
                    </h:panelGrid>
                    <p:commandButton action="#{reparto.registraReparto()}" update="tabella" value="#{msg.confermaDati}"/>
                </h:form>
            </div>
            <ui:include src="Footer.xhtml"/>
        </div>
    </h:body>
</html>

